function onDestroy_VM()
  activity.runFunc("onDestroy", {})
end

function onResume_VM()
  activity.runFunc("onResume", {})
end

function onStop_VM()
  activity.runFunc("onStop", {})
end

vmWindow = {
  CardView,
  backgroundColor = "0xFF2196F3",
  radius = 6,
  CardElevation = "4dp",
  id = "vmLinearLayout1",
  {
    TextView,
    textSize = "12sp",
    text = "Sorrowful Tool",
    background = "0",
    layout_marginBottom = "5dp",
    layout_marginTop = "5dp",
    layout_marginLeft = "15dp",
    layout_marginRight = "15dp",
    textColor = "0xffffffff"
  }
}
import("android.content.Context")
import("android.graphics.PixelFormat")
activity.setTheme(R.Theme_Blue)
variablesParams_x = activity.getWidth() / 1.3
variablesParams_y = activity.getHeight() / 5
variablesManager = activity.getSystemService(Context.WINDOW_SERVICE)
variablesParams = WindowManager.LayoutParams()
if Build.VERSION.SDK_INT >= 26 then
  variablesParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
else
  variablesParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT
end
variablesParams.format = PixelFormat.RGBA_8888
variablesParams.flags = WindowManager.LayoutParams().FLAG_NOT_FOCUSABLE
variablesParams.gravity = Gravity.LEFT | Gravity.TOP
variablesParams.x = variablesParams_x
variablesParams.y = variablesParams_y
variablesParams.width = WindowManager.LayoutParams.WRAP_CONTENT
variablesParams.height = WindowManager.LayoutParams.WRAP_CONTENT
vmWindowALY = loadlayout(vmWindow)
if ({
  pcall(function()
    variablesManager.addView(vmWindowALY, variablesParams)
  end
  )
})[1] == false then
  Toast.makeText(activity, "调试面板启动失败", Toast.LENGTH_SHORT).show()
else
  import("java.io.File")
  function getNowTime()
    local L0_0
    L0_0 = tostring
    return L0_0(os.date("%H:%M:%S"))
  end
  
  pcall(function()
    import("android.icu.text.SimpleDateFormat")
    function getNowTime()
      local L0_1
      L0_1 = tostring
      return L0_1(SimpleDateFormat("HH:mm:ss.SSS").format(Date()))
    end
    
  end
  )
  import("android.content.*")
  Transfer_parameters = {
    ...
  }
  vmWindow_2 = {
    LinearLayout,
    layout_width = "match_parent",
    layout_height = "match_parent",
    orientation = "vertical",
    id = "vmLinearLayout2",
    gravity = "bottom",
    backgroundColor = "0x80000000",
    {
      CardView,
      backgroundColor = "0xffffffff",
      radius = "0dp",
      layout_width = "match_parent",
      layout_height = "80%h",
      CardElevation = "0dp",
      {
        LinearLayout,
        layout_width = "match_parent",
        layout_height = "match_parent",
        orientation = "vertical",
        onClick = function()
          local L0_2, L1_3
          L0_2 = true
          return L0_2
        end
        ,
        {
          LinearLayout,
          layout_height = "35dp",
          layout_width = "-1",
          orientation = "horizontal",
          {
            TextView,
            layout_height = "-1",
            gravity = "center",
            layout_width = "-1",
            backgroundColor = "0XFFFFFFFF",
            layout_weight = "1",
            id = "vmPrint",
            textSize = "12sp",
            text = "Prints",
            textColor = "0xFF000000",
            layout_gravity = "center"
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "match_parent",
            layout_width = "1px"
          },
          {
            TextView,
            layout_height = "-1",
            gravity = "center",
            layout_width = "-1",
            backgroundColor = "0xfff2f1f6",
            layout_weight = "1",
            id = "vmVariable",
            text = "Variables",
            textSize = "12sp",
            textColor = "0xFF000000",
            layout_gravity = "center"
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "match_parent",
            layout_width = "1px"
          },
          {
            TextView,
            layout_height = "-1",
            gravity = "center",
            layout_width = "-1",
            backgroundColor = "0xfff2f1f6",
            layout_weight = "1",
            id = "vmLog",
            textSize = "12sp",
            textColor = "0xFF000000",
            text = "Logcat",
            layout_gravity = "center"
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "match_parent",
            layout_width = "1px"
          },
          {
            TextView,
            layout_height = "-1",
            gravity = "center",
            layout_width = "-1",
            backgroundColor = "0xfff2f1f6",
            layout_weight = "1",
            id = "vmOther",
            textSize = "12sp",
            textColor = "0xFF000000",
            text = "Text",
            layout_gravity = "center"
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "match_parent",
            layout_width = "1px"
          },
          {
            TextView,
            layout_height = "-1",
            gravity = "center",
            layout_width = "-1",
            backgroundColor = "0xfff2f1f6",
            layout_weight = "1",
            textSize = "12sp",
            textColor = "0xFF000000",
            id = "vmAndLuaPlus",
            text = "AndLua+",
            layout_gravity = "center"
          }
        },
        {
          TextView,
          backgroundColor = "0xffDDDDDD",
          layout_height = "1px",
          layout_width = "match_parent"
        },
        {
          LinearLayout,
          layout_height = "31dp",
          layout_width = "-1",
          Visibility = View.GONE,
          id = "vmVariable_Label",
          orientation = "vertical",
          {
            LinearLayout,
            layout_height = "30dp",
            layout_width = "-1",
            orientation = "horizontal",
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmVariable_Label_String",
              textSize = "12sp",
              text = "string",
              textColor = "0xFF2196F3",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmVariable_Label_Number",
              textSize = "12sp",
              text = "number",
              textColor = "0xFF000000",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmVariable_Label_Boolean",
              textSize = "12sp",
              text = "boolean",
              textColor = "0xFF000000",
              layout_gravity = "center"
            }
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "1px",
            layout_width = "match_parent"
          }
        },
        {
          LinearLayout,
          layout_height = "31dp",
          layout_width = "-1",
          Visibility = View.GONE,
          id = "vmLog_Label",
          orientation = "vertical",
          {
            LinearLayout,
            layout_height = "30dp",
            layout_width = "-1",
            orientation = "horizontal",
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_All",
              textSize = "12sp",
              text = "All",
              textColor = "0xFF2196F3",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_Lua",
              textSize = "12sp",
              text = "Lua",
              textColor = "0xFF000000",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_Test",
              textSize = "12sp",
              text = "Test",
              textColor = "0xFF000000",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_Tcc",
              textSize = "12sp",
              text = "Tcc",
              textColor = "0xFF000000",
              layout_gravity = "center"
            }
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "1px",
            layout_width = "match_parent"
          }
        },
        {
          LinearLayout,
          layout_height = "31dp",
          layout_width = "-1",
          Visibility = View.GONE,
          id = "vmLog_Label_2",
          orientation = "vertical",
          {
            LinearLayout,
            layout_height = "30dp",
            layout_width = "-1",
            orientation = "horizontal",
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_Error",
              textSize = "12sp",
              text = "Error",
              textColor = "0xFF000000",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_Warning",
              textSize = "12sp",
              text = "Warning",
              textColor = "0xFF000000",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_Info",
              textSize = "12sp",
              text = "Info",
              textColor = "0xFF000000",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_Debug",
              textSize = "12sp",
              text = "Debug",
              textColor = "0xFF000000",
              layout_gravity = "center"
            },
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "match_parent",
              layout_width = "1px"
            },
            {
              TextView,
              layout_height = "-1",
              gravity = "center",
              layout_width = "-1",
              layout_weight = "1",
              id = "vmLog_Label_Verbose",
              textSize = "12sp",
              text = "Verbose",
              textColor = "0xFF000000",
              layout_gravity = "center"
            }
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "1px",
            layout_width = "match_parent"
          }
        },
        {
          ListView,
          layout_width = "match_parent",
          id = "vmPrintListView1",
          layout_weight = "1",
          fastScrollEnabled = true,
          layout_height = "match_parent"
        },
        {
          PageView,
          layout_height = "fill",
          layout_weight = "1",
          id = "variable_pagev",
          Visibility = View.GONE,
          layout_width = "fill",
          pages = {
            {
              ListView,
              layout_width = "match_parent",
              id = "vmStringListView1",
              fastScrollEnabled = true,
              layout_height = "match_parent"
            },
            {
              ListView,
              layout_width = "match_parent",
              id = "vmNumberListView1",
              fastScrollEnabled = true,
              layout_height = "match_parent"
            },
            {
              ListView,
              layout_width = "match_parent",
              id = "vmBooleanListView1",
              fastScrollEnabled = true,
              layout_height = "match_parent"
            }
          }
        },
        {
          ListView,
          layout_width = "match_parent",
          id = "vmLogListView1",
          layout_weight = "1",
          fastScrollEnabled = true,
          Visibility = View.GONE,
          layout_height = "match_parent"
        },
        {
          LinearLayout,
          layout_height = "fill",
          layout_width = "-1",
          Visibility = View.GONE,
          layout_weight = "1",
          id = "vmOther_Label",
          orientation = "vertical",
          {
            EditText,
            background = "0",
            textSize = "11sp",
            layout_width = "match_parent",
            hint = "Text...",
            textColor = "0xff000000",
            gravity = "top",
            layout_weight = "1",
            id = "vmText"
          }
        },
        {
          LinearLayout,
          layout_height = "fill",
          layout_weight = "1",
          layout_width = "-1",
          Visibility = View.GONE,
          id = "vmAndLuaPlus_Label",
          orientation = "vertical",
          {
            LinearLayout,
            layout_width = "-1",
            layout_height = "30dp",
            layout_marginTop = "10dp",
            layout_marginLeft = "10dp",
            layout_marginRight = "10dp",
            orientation = "horizontal",
            {
              LinearLayout,
              orientation = "vertical",
              layout_height = "fill",
              layout_weight = "1",
              layout_marginRight = "5dp",
              backgroundColor = "0xffDDDDDD",
              {
                LinearLayout,
                layout_margin = "1px",
                backgroundColor = "0xfff2f1f6",
                layout_height = "match_parent",
                layout_width = "match_parent",
                onClick = function()
                  activity.finish()
                  return true
                end
                ,
                {
                  TextView,
                  text = "关闭当前界面",
                  layout_weight = "1",
                  gravity = "center",
                  textSize = "11sp",
                  layout_height = "fill",
                  layout_width = "-1",
                  textColor = "0xff000000"
                }
              }
            },
            {
              LinearLayout,
              orientation = "vertical",
              layout_weight = "1",
              layout_height = "fill",
              layout_marginLeft = "5dp",
              backgroundColor = "0xffDDDDDD",
              {
                LinearLayout,
                layout_margin = "1px",
                backgroundColor = "0xfff2f1f6",
                layout_height = "match_parent",
                layout_width = "match_parent",
                onClick = function()
                  activity.recreate()
                  return true
                end
                ,
                {
                  TextView,
                  text = "重构当前界面",
                  gravity = "center",
                  layout_weight = "1",
                  layout_height = "fill",
                  layout_width = "-1",
                  textSize = "11sp",
                  textColor = "0xff000000"
                }
              }
            }
          },
          {
            LinearLayout,
            layout_width = "-1",
            layout_height = "30dp",
            layout_marginTop = "10dp",
            layout_marginLeft = "10dp",
            layout_marginRight = "10dp",
            orientation = "horizontal",
            {
              LinearLayout,
              orientation = "vertical",
              layout_height = "fill",
              layout_weight = "1",
              backgroundColor = "0xffDDDDDD",
              {
                LinearLayout,
                layout_margin = "1px",
                backgroundColor = "0xfff2f1f6",
                layout_height = "match_parent",
                layout_width = "match_parent",
                onClick = function()
                  activity.finish()
                  activity.newActivity(luajava.luapath, Transfer_parameters)
                  return true
                end
                ,
                {
                  TextView,
                  text = "重启当前界面",
                  layout_weight = "1",
                  gravity = "center",
                  textSize = "11sp",
                  layout_height = "fill",
                  layout_width = "-1",
                  textColor = "0xff000000"
                }
              }
            }
          },
          {
            LinearLayout,
            layout_width = "-1",
            layout_height = "30dp",
            orientation = "vertical",
            layout_weight = "1",
            gravity = "bottom",
            {
              TextView,
              backgroundColor = "0xffDDDDDD",
              layout_height = "1px",
              layout_width = "match_parent"
            },
            {
              LinearLayout,
              layout_width = "-1",
              orientation = "horizontal",
              {
                EditText,
                background = "0",
                textSize = "11sp",
                layout_width = "match_parent",
                hint = "Lua code...",
                textColor = "0xff000000",
                layout_weight = "1",
                id = "vmLuaCode"
              },
              {
                LinearLayout,
                orientation = "vertical",
                layout_height = "fill",
                backgroundColor = "0xffDDDDDD",
                {
                  LinearLayout,
                  layout_margin = "1px",
                  backgroundColor = "0xfff2f1f6",
                  layout_height = "match_parent",
                  layout_width = "match_parent",
                  onClick = function()
                    pcall(function()
                      loadstring(tostring(vmLuaCode.Text))()
                    end
                    )
                    vmLuaCode.Text = ""
                    return true
                  end
                  ,
                  {
                    TextView,
                    text = "Run",
                    gravity = "center",
                    layout_height = "fill",
                    layout_width = "-1",
                    textSize = "11sp",
                    paddingLeft = "15dp",
                    paddingRight = "15dp",
                    textColor = "0xff000000"
                  }
                }
              }
            }
          }
        },
        {
          TextView,
          backgroundColor = "0xffDDDDDD",
          layout_height = "1px",
          layout_width = "match_parent"
        },
        {
          LinearLayout,
          orientation = "horizontal",
          layout_width = "match_parent",
          layout_height = "40dp",
          backgroundColor = "0xfff2f1f6",
          {
            TextView,
            text = "Clear",
            layout_width = "fill",
            layout_height = "fill",
            textColor = "0xff000000",
            textSize = "11sp",
            gravity = "center",
            id = "vmClear",
            layout_weight = "1"
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "match_parent",
            layout_width = "1px",
            id = "vmClear_line"
          },
          {
            TextView,
            text = "Paste",
            layout_width = "fill",
            layout_height = "fill",
            textColor = "0xff000000",
            textSize = "11sp",
            gravity = "center",
            id = "vmClear3",
            layout_weight = "1",
            Visibility = View.GONE
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "match_parent",
            layout_width = "1px",
            id = "vmClear_line3",
            Visibility = View.GONE
          },
          {
            TextView,
            text = "Clear",
            layout_width = "fill",
            layout_height = "fill",
            textColor = "0xff000000",
            textSize = "11sp",
            gravity = "center",
            id = "vmClear2",
            layout_weight = "1",
            Visibility = View.GONE
          },
          {
            TextView,
            backgroundColor = "0xffDDDDDD",
            layout_height = "match_parent",
            layout_width = "1px",
            id = "vmClear_line2",
            Visibility = View.GONE
          },
          {
            TextView,
            text = "Hide",
            textSize = "11sp",
            layout_width = "fill",
            gravity = "center",
            textColor = "0xff000000",
            layout_height = "fill",
            layout_weight = "1",
            onClick = function()
              changeVMWindow()
              return true
            end
            
          }
        }
      }
    }
  }
  vmWindowALY_2 = loadlayout(vmWindow_2)
  function onDestroy_VM()
    activity.runFunc("onDestroy", {})
    pcall(function()
      if isOpenPanel == false then
        variablesManager.removeView(vmWindowALY)
      else
        variablesManager.removeView(vmWindowALY_2)
      end
    end
    )
  end
  
  function onStop_VM()
    activity.runFunc("onStop", {})
    if activity.getSystemService(Context.ACTIVITY_SERVICE).getRunningTasks(2).get(0).topActivity ~= nil and activity.getSystemService(Context.ACTIVITY_SERVICE).getRunningTasks(2).get(0).topActivity.getClassName():find("com.androlua.LuaActivity") then
    end
    if true == true then
      pcall(function()
        if isOpenPanel == false then
          variablesManager.removeView(vmWindowALY)
        else
          variablesManager.removeView(vmWindowALY_2)
        end
      end
      )
    end
  end
  
  function onResume_VM()
    activity.runFunc("onResume", {})
    if activity.getSystemService(Context.ACTIVITY_SERVICE).getRunningTasks(2).get(0).topActivity ~= nil and activity.getSystemService(Context.ACTIVITY_SERVICE).getRunningTasks(2).get(0).topActivity.getClassName():find("com.androlua.LuaActivity") then
    end
    if true == true then
      pcall(function()
        if isOpenPanel == false then
          variablesManager.addView(vmWindowALY, variablesParams)
        else
          variablesManager.addView(vmWindowALY_2, variablesParams)
        end
      end
      )
    end
  end
  
  function vmLinearLayout1.OnTouchListener(A0_4, A1_5)
    if A1_5.getAction() == MotionEvent.ACTION_DOWN then
      variablesParams_firstX = A1_5.getRawX()
      variablesParams_firstY = A1_5.getRawY()
      variablesParams_wmX = variablesParams.x
      variablesParams_wmY = variablesParams.y
    elseif A1_5.getAction() == MotionEvent.ACTION_MOVE then
      variablesParams_x = variablesParams_wmX + (A1_5.getRawX() - variablesParams_firstX)
      variablesParams_y = variablesParams_wmY + (A1_5.getRawY() - variablesParams_firstY)
      variablesParams.x = variablesParams_x
      variablesParams.y = variablesParams_y
      variablesManager.updateViewLayout(vmWindowALY, variablesParams)
      return false
    end
  end
  
  function vmRefresh_variables()
    vmStringListView1_adp.clear()
    vmNumberListView1_adp.clear()
    vmBooleanListView1_adp.clear()
    for _FORV_3_, _FORV_4_ in pairs(_G) do
      if type(_FORV_4_) == "string" and _FORV_3_ ~= "_VERSION" then
        table.insert(vmStringListView1_data, {
          text = {
            Text = tostring(_FORV_3_ .. " => " .. tostring(_FORV_4_)),
            textColor = 4278218939
          }
        })
        vmStringListView1_adp.notifyDataSetChanged()
      elseif type(_FORV_4_) == "number" and _FORV_3_ ~= "variablesParams_x" and _FORV_3_ ~= "variablesParams_y" and _FORV_3_ ~= "variablesParams_wmX" and _FORV_3_ ~= "variablesParams_wmY" and _FORV_3_ ~= "variablesParams_firstX" and _FORV_3_ ~= "variablesParams_firstY" then
        table.insert(vmNumberListView1_data, {
          text = {
            Text = tostring(_FORV_3_ .. " => " .. tostring(_FORV_4_)),
            textColor = 4278218939
          }
        })
        vmNumberListView1_adp.notifyDataSetChanged()
      elseif type(_FORV_4_) == "boolean" and _FORV_3_ ~= "isOpenPanel" then
        table.insert(vmBooleanListView1_data, {
          text = {
            Text = tostring(_FORV_3_ .. " => " .. tostring(_FORV_4_)),
            textColor = 4278218939
          }
        })
        vmBooleanListView1_adp.notifyDataSetChanged()
      end
    end
  end
  
  function vmReadlog(A0_6)
    p = io.popen("logcat -d -v long " .. A0_6)
    p:close()
    if #p:read("*a"):gsub([[
%-+ beginning of[^
]*
]], "") == 0 then
    end
    return "<run the app to see its log output>"
  end
  
  function vmClearlog()
    p = io.popen("logcat -c")
    p:close()
    return (p:read("*a"))
  end
  
  function vmShowLog(A0_7)
    vmLogListView1_adp.clear()
    for _FORV_5_ in A0_7:gfind(_UPVALUE1_) do
      if 1 ~= 1 then
        table.insert(vmLogListView1_data, {
          text = {
            Text = tostring(tostring(A0_7:sub(1, _FORV_5_ - 1))),
            textColor = 4278218939
          }
        })
      end
    end
    table.insert(vmLogListView1_data, {
      text = {
        Text = tostring(tostring(A0_7:sub(_FORV_5_))),
        textColor = 4278218939
      }
    })
    vmLogListView1_adp.notifyDataSetChanged()
  end
  
  function vmRefreshLog()
    local L0_8
    L0_8 = vmShowLog
    L0_8(vmReadlog(_UPVALUE1_))
  end
  
  isOpenPanel = false
  function changeVMWindow()
    if isOpenPanel == false then
      isOpenPanel = true
      if vmVariable_Label.Visibility ~= View.GONE then
        vmRefresh_variables()
      end
      variablesManager.removeView(vmWindowALY)
      if vmAndLuaPlus_Label.Visibility ~= View.GONE or vmOther_Label.Visibility ~= View.GONE then
        variablesParams.flags = WindowManager.LayoutParams().FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams().FLAG_NOT_TOUCH_MODAL
      else
        variablesParams.flags = WindowManager.LayoutParams().FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams().FLAG_NOT_FOCUSABLE
      end
      variablesParams.x = activity.getWidth()
      variablesParams.y = activity.getHeight()
      variablesParams.width = WindowManager.LayoutParams.MATCH_PARENT
      variablesParams.height = WindowManager.LayoutParams.MATCH_PARENT
      variablesManager.addView(vmWindowALY_2, variablesParams)
    else
      isOpenPanel = false
      variablesManager.removeView(vmWindowALY_2)
      variablesParams.flags = WindowManager.LayoutParams().FLAG_NOT_FOCUSABLE
      variablesParams.x = variablesParams_x
      variablesParams.y = variablesParams_y
      variablesParams.width = WindowManager.LayoutParams.WRAP_CONTENT
      variablesParams.height = WindowManager.LayoutParams.WRAP_CONTENT
      variablesManager.addView(vmWindowALY, variablesParams)
    end
  end
  
  vmItem = {
    LinearLayout,
    orientation = "vertical",
    layout_width = "fill",
    {
      TextView,
      id = "text",
      textSize = "12sp",
      layout_width = "fill",
      MaxLines = 5,
      layout_margin = "5dp",
      ellipsize = "end"
    },
    {
      TextView,
      backgroundColor = "0xffeeeeee",
      layout_height = "1px",
      layout_width = "match_parent"
    }
  }
  vmPrintListView1_data = {}
  vmPrintListView1_adp = LuaAdapter(activity, vmPrintListView1_data, vmItem)
  vmPrintListView1.Adapter = vmPrintListView1_adp
  vmStringListView1_data = {}
  vmStringListView1_adp = LuaAdapter(activity, vmStringListView1_data, vmItem)
  vmStringListView1.Adapter = vmStringListView1_adp
  vmNumberListView1_data = {}
  vmNumberListView1_adp = LuaAdapter(activity, vmNumberListView1_data, vmItem)
  vmNumberListView1.Adapter = vmNumberListView1_adp
  vmBooleanListView1_data = {}
  vmBooleanListView1_adp = LuaAdapter(activity, vmBooleanListView1_data, vmItem)
  vmBooleanListView1.Adapter = vmBooleanListView1_adp
  vmLogListView1_data = {}
  vmLogListView1_adp = LuaAdapter(activity, vmLogListView1_data, vmItem)
  vmLogListView1.Adapter = vmLogListView1_adp
  function vmPrint.onClick()
    variablesParams.flags = WindowManager.LayoutParams().FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams().FLAG_NOT_FOCUSABLE
    variablesManager.updateViewLayout(vmWindowALY_2, variablesParams)
    vmPrint.backgroundColor = 4294967295
    vmVariable.backgroundColor = 4294111734
    vmLog.backgroundColor = 4294111734
    vmOther.backgroundColor = 4294111734
    vmAndLuaPlus.backgroundColor = 4294111734
    vmVariable_Label.setVisibility(View.GONE)
    vmPrintListView1.setVisibility(View.VISIBLE)
    variable_pagev.setVisibility(View.GONE)
    vmLogListView1.setVisibility(View.GONE)
    vmLog_Label.setVisibility(View.GONE)
    vmLog_Label_2.setVisibility(View.GONE)
    vmClear.setVisibility(View.VISIBLE)
    vmClear_line.setVisibility(View.VISIBLE)
    vmClear_line2.setVisibility(View.GONE)
    vmClear2.setVisibility(View.GONE)
    vmClear_line3.setVisibility(View.GONE)
    vmClear3.setVisibility(View.GONE)
    vmAndLuaPlus_Label.setVisibility(View.GONE)
    vmOther_Label.setVisibility(View.GONE)
    vmClear.Text = "Clear"
    return true
  end
  
  function vmVariable.onClick()
    variablesParams.flags = WindowManager.LayoutParams().FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams().FLAG_NOT_FOCUSABLE
    variablesManager.updateViewLayout(vmWindowALY_2, variablesParams)
    vmRefresh_variables()
    vmVariable.backgroundColor = 4294967295
    vmPrint.backgroundColor = 4294111734
    vmLog.backgroundColor = 4294111734
    vmOther.backgroundColor = 4294111734
    vmAndLuaPlus.backgroundColor = 4294111734
    vmVariable_Label.setVisibility(View.VISIBLE)
    vmPrintListView1.setVisibility(View.GONE)
    variable_pagev.setVisibility(View.VISIBLE)
    vmLogListView1.setVisibility(View.GONE)
    vmLog_Label.setVisibility(View.GONE)
    vmLog_Label_2.setVisibility(View.GONE)
    vmClear.setVisibility(View.VISIBLE)
    vmClear_line.setVisibility(View.VISIBLE)
    vmClear_line2.setVisibility(View.GONE)
    vmClear2.setVisibility(View.GONE)
    vmClear_line3.setVisibility(View.GONE)
    vmClear3.setVisibility(View.GONE)
    vmAndLuaPlus_Label.setVisibility(View.GONE)
    vmOther_Label.setVisibility(View.GONE)
    vmClear.Text = "Refresh"
    return true
  end
  
  function vmLog.onClick()
    variablesParams.flags = WindowManager.LayoutParams().FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams().FLAG_NOT_FOCUSABLE
    variablesManager.updateViewLayout(vmWindowALY_2, variablesParams)
    vmRefreshLog()
    vmLog.backgroundColor = 4294967295
    vmVariable.backgroundColor = 4294111734
    vmPrint.backgroundColor = 4294111734
    vmOther.backgroundColor = 4294111734
    vmAndLuaPlus.backgroundColor = 4294111734
    vmVariable_Label.setVisibility(View.GONE)
    vmPrintListView1.setVisibility(View.GONE)
    variable_pagev.setVisibility(View.GONE)
    vmLogListView1.setVisibility(View.VISIBLE)
    vmLog_Label.setVisibility(View.VISIBLE)
    vmLog_Label_2.setVisibility(View.VISIBLE)
    vmClear.setVisibility(View.VISIBLE)
    vmClear_line.setVisibility(View.VISIBLE)
    vmClear_line2.setVisibility(View.GONE)
    vmClear2.setVisibility(View.GONE)
    vmClear_line3.setVisibility(View.GONE)
    vmClear3.setVisibility(View.GONE)
    vmAndLuaPlus_Label.setVisibility(View.GONE)
    vmOther_Label.setVisibility(View.GONE)
    vmClear.Text = "Clear"
    return true
  end
  
  function vmOther_onClick()
    variablesParams.flags = WindowManager.LayoutParams().FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams().FLAG_NOT_TOUCH_MODAL
    variablesManager.updateViewLayout(vmWindowALY_2, variablesParams)
    vmOther.backgroundColor = 4294967295
    vmVariable.backgroundColor = 4294111734
    vmLog.backgroundColor = 4294111734
    vmPrint.backgroundColor = 4294111734
    vmAndLuaPlus.backgroundColor = 4294111734
    vmVariable_Label.setVisibility(View.GONE)
    vmPrintListView1.setVisibility(View.GONE)
    variable_pagev.setVisibility(View.GONE)
    vmLogListView1.setVisibility(View.GONE)
    vmLog_Label.setVisibility(View.GONE)
    vmLog_Label_2.setVisibility(View.GONE)
    vmClear.setVisibility(View.VISIBLE)
    vmClear_line.setVisibility(View.VISIBLE)
    vmClear_line2.setVisibility(View.VISIBLE)
    vmClear2.setVisibility(View.VISIBLE)
    vmClear_line3.setVisibility(View.VISIBLE)
    vmClear3.setVisibility(View.VISIBLE)
    vmAndLuaPlus_Label.setVisibility(View.GONE)
    vmOther_Label.setVisibility(View.VISIBLE)
    vmClear.Text = "Copy"
  end
  
  function vmOther.onClick()
    vmOther_onClick()
    return true
  end
  
  function vmAndLuaPlus.onClick()
    variablesParams.flags = WindowManager.LayoutParams().FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams().FLAG_NOT_TOUCH_MODAL
    variablesManager.updateViewLayout(vmWindowALY_2, variablesParams)
    vmAndLuaPlus.backgroundColor = 4294967295
    vmVariable.backgroundColor = 4294111734
    vmLog.backgroundColor = 4294111734
    vmOther.backgroundColor = 4294111734
    vmPrint.backgroundColor = 4294111734
    vmVariable_Label.setVisibility(View.GONE)
    vmPrintListView1.setVisibility(View.GONE)
    variable_pagev.setVisibility(View.GONE)
    vmLogListView1.setVisibility(View.GONE)
    vmLog_Label.setVisibility(View.GONE)
    vmLog_Label_2.setVisibility(View.GONE)
    vmClear.setVisibility(View.GONE)
    vmClear_line.setVisibility(View.GONE)
    vmClear_line2.setVisibility(View.GONE)
    vmClear2.setVisibility(View.GONE)
    vmClear_line3.setVisibility(View.GONE)
    vmClear3.setVisibility(View.GONE)
    vmAndLuaPlus_Label.setVisibility(View.VISIBLE)
    vmOther_Label.setVisibility(View.GONE)
    vmClear.Text = ""
    return true
  end
  
  function vmClear.onClick()
    if vmClear.Text == "Clear" then
      if vmLogListView1.Visibility ~= View.GONE then
        vmLogListView1_adp.clear()
        vmLogListView1_adp.notifyDataSetChanged()
      else
        vmPrintListView1_adp.clear()
        vmPrintListView1_adp.notifyDataSetChanged()
      end
    elseif vmClear.Text == "Refresh" then
      vmRefresh_variables()
    elseif vmClear.Text == "Copy" then
      activity.getSystemService(Context.CLIPBOARD_SERVICE).setText(tostring(vmText.Text))
    end
    return true
  end
  
  function vmClear2.onClick()
    local L1_9
    L1_9 = vmText
    L1_9.Text = ""
    L1_9 = true
    return L1_9
  end
  
  function vmClear3.onClick()
    vmText.Text = tostring(activity.getSystemService(Context.CLIPBOARD_SERVICE).getText())
    return true
  end
  
  function vmVariable_Label_String.onClick()
    variable_pagev.showPage(0)
    vmVariable_Label_String.textColor = 4280391411
    vmVariable_Label_Number.textColor = 4278190080
    vmVariable_Label_Boolean.textColor = 4278190080
    return true
  end
  
  function vmVariable_Label_Number.onClick()
    variable_pagev.showPage(1)
    vmVariable_Label_Number.textColor = 4280391411
    vmVariable_Label_String.textColor = 4278190080
    vmVariable_Label_Boolean.textColor = 4278190080
    return true
  end
  
  function vmVariable_Label_Boolean.onClick()
    variable_pagev.showPage(2)
    vmVariable_Label_Boolean.textColor = 4280391411
    vmVariable_Label_Number.textColor = 4278190080
    vmVariable_Label_String.textColor = 4278190080
    return true
  end
  
  function vmLog_Label_All.onClick()
    vmLog_Label_All.textColor = 4280391411
    vmLog_Label_Lua.textColor = 4278190080
    vmLog_Label_Test.textColor = 4278190080
    vmLog_Label_Tcc.textColor = 4278190080
    vmLog_Label_Error.textColor = 4278190080
    vmLog_Label_Info.textColor = 4278190080
    vmLog_Label_Warning.textColor = 4278190080
    vmLog_Label_Debug.textColor = 4278190080
    vmLog_Label_Verbose.textColor = 4278190080
    _UPVALUE1_ = ""
    vmRefreshLog()
    return true
  end
  
  function vmLog_Label_Lua.onClick()
    vmLog_Label_Lua.textColor = 4280391411
    vmLog_Label_All.textColor = 4278190080
    vmLog_Label_Test.textColor = 4278190080
    vmLog_Label_Tcc.textColor = 4278190080
    vmLog_Label_Error.textColor = 4278190080
    vmLog_Label_Info.textColor = 4278190080
    vmLog_Label_Warning.textColor = 4278190080
    vmLog_Label_Debug.textColor = 4278190080
    vmLog_Label_Verbose.textColor = 4278190080
    _UPVALUE1_ = "lua:* *:S"
    vmRefreshLog()
    return true
  end
  
  function vmLog_Label_Test.onClick()
    vmLog_Label_Test.textColor = 4280391411
    vmLog_Label_Lua.textColor = 4278190080
    vmLog_Label_All.textColor = 4278190080
    vmLog_Label_Tcc.textColor = 4278190080
    vmLog_Label_Error.textColor = 4278190080
    vmLog_Label_Info.textColor = 4278190080
    vmLog_Label_Warning.textColor = 4278190080
    vmLog_Label_Debug.textColor = 4278190080
    vmLog_Label_Verbose.textColor = 4278190080
    _UPVALUE1_ = "test:* *:S"
    vmRefreshLog()
    return true
  end
  
  function vmLog_Label_Tcc.onClick()
    vmLog_Label_Tcc.textColor = 4280391411
    vmLog_Label_Lua.textColor = 4278190080
    vmLog_Label_Test.textColor = 4278190080
    vmLog_Label_All.textColor = 4278190080
    vmLog_Label_Error.textColor = 4278190080
    vmLog_Label_Info.textColor = 4278190080
    vmLog_Label_Warning.textColor = 4278190080
    vmLog_Label_Debug.textColor = 4278190080
    vmLog_Label_Verbose.textColor = 4278190080
    _UPVALUE1_ = "tcc:* *:S"
    vmRefreshLog()
    return true
  end
  
  function vmLog_Label_Error.onClick()
    vmLog_Label_Error.textColor = 4280391411
    vmLog_Label_Lua.textColor = 4278190080
    vmLog_Label_Test.textColor = 4278190080
    vmLog_Label_Tcc.textColor = 4278190080
    vmLog_Label_All.textColor = 4278190080
    vmLog_Label_Info.textColor = 4278190080
    vmLog_Label_Warning.textColor = 4278190080
    vmLog_Label_Debug.textColor = 4278190080
    vmLog_Label_Verbose.textColor = 4278190080
    _UPVALUE1_ = "*:E"
    vmRefreshLog()
    return true
  end
  
  function vmLog_Label_Info.onClick()
    vmLog_Label_Info.textColor = 4280391411
    vmLog_Label_Lua.textColor = 4278190080
    vmLog_Label_Test.textColor = 4278190080
    vmLog_Label_Tcc.textColor = 4278190080
    vmLog_Label_Error.textColor = 4278190080
    vmLog_Label_All.textColor = 4278190080
    vmLog_Label_Warning.textColor = 4278190080
    vmLog_Label_Debug.textColor = 4278190080
    vmLog_Label_Verbose.textColor = 4278190080
    _UPVALUE1_ = "*:I"
    vmRefreshLog()
    return true
  end
  
  function vmLog_Label_Warning.onClick()
    vmLog_Label_Warning.textColor = 4280391411
    vmLog_Label_Lua.textColor = 4278190080
    vmLog_Label_Test.textColor = 4278190080
    vmLog_Label_Tcc.textColor = 4278190080
    vmLog_Label_Error.textColor = 4278190080
    vmLog_Label_Info.textColor = 4278190080
    vmLog_Label_All.textColor = 4278190080
    vmLog_Label_Debug.textColor = 4278190080
    vmLog_Label_Verbose.textColor = 4278190080
    _UPVALUE1_ = "*:W"
    vmRefreshLog()
    return true
  end
  
  function vmLog_Label_Debug.onClick()
    vmLog_Label_Debug.textColor = 4280391411
    vmLog_Label_Lua.textColor = 4278190080
    vmLog_Label_Test.textColor = 4278190080
    vmLog_Label_Tcc.textColor = 4278190080
    vmLog_Label_Error.textColor = 4278190080
    vmLog_Label_Info.textColor = 4278190080
    vmLog_Label_Warning.textColor = 4278190080
    vmLog_Label_All.textColor = 4278190080
    vmLog_Label_Verbose.textColor = 4278190080
    _UPVALUE1_ = "*:D"
    vmRefreshLog()
    return true
  end
  
  function vmLog_Label_Verbose.onClick()
    vmLog_Label_Verbose.textColor = 4280391411
    vmLog_Label_Lua.textColor = 4278190080
    vmLog_Label_Test.textColor = 4278190080
    vmLog_Label_Tcc.textColor = 4278190080
    vmLog_Label_Error.textColor = 4278190080
    vmLog_Label_Info.textColor = 4278190080
    vmLog_Label_Warning.textColor = 4278190080
    vmLog_Label_Debug.textColor = 4278190080
    vmLog_Label_All.textColor = 4278190080
    _UPVALUE1_ = "*:V"
    vmRefreshLog()
    return true
  end
  
  variable_pagev.setOnPageChangeListener(PageView.OnPageChangeListener({
    onPageScrolled = function(A0_10, A1_11, A2_12)
      local L3_13
      if A2_12 == 0 then
        if A0_10 == 0 then
          L3_13 = vmVariable_Label_String
          L3_13.textColor = 4280391411
          L3_13 = vmVariable_Label_Number
          L3_13.textColor = 4278190080
          L3_13 = vmVariable_Label_Boolean
          L3_13.textColor = 4278190080
        elseif A0_10 == 1 then
          L3_13 = vmVariable_Label_Number
          L3_13.textColor = 4280391411
          L3_13 = vmVariable_Label_String
          L3_13.textColor = 4278190080
          L3_13 = vmVariable_Label_Boolean
          L3_13.textColor = 4278190080
        elseif A0_10 == 2 then
          L3_13 = vmVariable_Label_Boolean
          L3_13.textColor = 4280391411
          L3_13 = vmVariable_Label_Number
          L3_13.textColor = 4278190080
          L3_13 = vmVariable_Label_String
          L3_13.textColor = 4278190080
        end
      end
    end
    
  }))
  function vmLinearLayout1.onClick()
    changeVMWindow()
    return true
  end
  
  function vmLinearLayout2.onClick()
    changeVMWindow()
    return true
  end
  
  function vmPrintListView1.onItemClick(A0_14, A1_15, A2_16, A3_17)
    vmText.Text = tostring(A1_15.Tag.text.Text)
    vmOther_onClick()
    return true
  end
  
  function vmLogListView1.onItemClick(A0_18, A1_19, A2_20, A3_21)
    vmText.Text = tostring(A1_19.Tag.text.Text)
    vmOther_onClick()
    return true
  end
  
  function vmStringListView1.onItemClick(A0_22, A1_23, A2_24, A3_25)
    vmText.Text = tostring(A1_23.Tag.text.Text)
    vmOther_onClick()
    return true
  end
  
  function vmNumberListView1.onItemClick(A0_26, A1_27, A2_28, A3_29)
    vmText.Text = tostring(A1_27.Tag.text.Text)
    vmOther_onClick()
    return true
  end
  
  function vmBooleanListView1.onItemClick(A0_30, A1_31, A2_32, A3_33)
    vmText.Text = tostring(A1_31.Tag.text.Text)
    vmOther_onClick()
    return true
  end
  
  function vmPrintListView1.onItemLongClick(A0_34, A1_35, A2_36, A3_37)
    activity.getSystemService(Context.CLIPBOARD_SERVICE).setText(tostring(A1_35.Tag.text.Text))
    return true
  end
  
  function vmLogListView1.onItemLongClick(A0_38, A1_39, A2_40, A3_41)
    activity.getSystemService(Context.CLIPBOARD_SERVICE).setText(tostring(A1_39.Tag.text.Text))
    return true
  end
  
  function vmStringListView1.onItemLongClick(A0_42, A1_43, A2_44, A3_45)
    activity.getSystemService(Context.CLIPBOARD_SERVICE).setText(tostring(A1_43.Tag.text.Text))
    return true
  end
  
  function vmNumberListView1.onItemLongClick(A0_46, A1_47, A2_48, A3_49)
    activity.getSystemService(Context.CLIPBOARD_SERVICE).setText(tostring(A1_47.Tag.text.Text))
    return true
  end
  
  function vmBooleanListView1.onItemLongClick(A0_50, A1_51, A2_52, A3_53)
    activity.getSystemService(Context.CLIPBOARD_SERVICE).setText(tostring(A1_51.Tag.text.Text))
    return true
  end
  
  function _G.print(...)
    local L1_54
    L1_54 = select
    L1_54 = L1_54("#", ...)
    for _FORV_5_ = 1, L1_54 do
    end
    table.insert(vmPrintListView1_data, {
      text = {
        Text = tostring((getNowTime())) .. ": " .. tostring((string.sub("" .. tostring((select(_FORV_5_, ...))) .. "\t\t", 0, -3))),
        textColor = 4278218939
      }
    })
    vmPrintListView1_adp.notifyDataSetChanged()
  end
  
  function print_error(...)
    local L1_55
    L1_55 = select
    L1_55 = L1_55("#", ...)
    for _FORV_5_ = 1, L1_55 do
    end
    table.insert(vmPrintListView1_data, {
      text = {
        Text = tostring((getNowTime())) .. ": " .. tostring((string.sub("" .. tostring((select(_FORV_5_, ...))) .. "\t\t", 0, -3))),
        textColor = 4294901766
      }
    })
    vmPrintListView1_adp.notifyDataSetChanged()
  end
  
  function print_assert(...)
    local L1_56
    L1_56 = select
    L1_56 = L1_56("#", ...)
    for _FORV_5_ = 1, L1_56 do
    end
    table.insert(vmPrintListView1_data, {
      text = {
        Text = tostring((getNowTime())) .. ": " .. tostring((string.sub("" .. tostring((select(_FORV_5_, ...))) .. "\t\t", 0, -3))),
        textColor = 4287561733
      }
    })
    vmPrintListView1_adp.notifyDataSetChanged()
  end
  
  function print_info(...)
    local L1_57
    L1_57 = select
    L1_57 = L1_57("#", ...)
    for _FORV_5_ = 1, L1_57 do
    end
    table.insert(vmPrintListView1_data, {
      text = {
        Text = tostring((getNowTime())) .. ": " .. tostring((string.sub("" .. tostring((select(_FORV_5_, ...))) .. "\t\t", 0, -3))),
        textColor = 4282956593
      }
    })
    vmPrintListView1_adp.notifyDataSetChanged()
  end
  
  function print_verbose(...)
    local L1_58
    L1_58 = select
    L1_58 = L1_58("#", ...)
    for _FORV_5_ = 1, L1_58 do
    end
    table.insert(vmPrintListView1_data, {
      text = {
        Text = tostring((getNowTime())) .. ": " .. tostring((string.sub("" .. tostring((select(_FORV_5_, ...))) .. "\t\t", 0, -3))),
        textColor = 4290493371
      }
    })
    vmPrintListView1_adp.notifyDataSetChanged()
  end
  
  function print_warning(...)
    local L1_59
    L1_59 = select
    L1_59 = L1_59("#", ...)
    for _FORV_5_ = 1, L1_59 do
    end
    table.insert(vmPrintListView1_data, {
      text = {
        Text = tostring((getNowTime())) .. ": " .. tostring((string.sub("" .. tostring((select(_FORV_5_, ...))) .. "\t\t", 0, -3))),
        textColor = 4290493219
      }
    })
    vmPrintListView1_adp.notifyDataSetChanged()
  end
  
  table.insert(vmPrintListView1_data, {
    text = {
      Text = tostring("System: " .. tostring(Build.MODEL) .. ", Android " .. tostring(Build.VERSION.RELEASE) .. " (SDK" .. tostring(Build.VERSION.SDK) .. "), AndLua+ 6.8-beta5"),
      textColor = 4282956593
    }
  })
  table.insert(vmPrintListView1_data, {
    text = {
      Text = "File: " .. tostring(luajava.luapath),
      textColor = 4282956593
    }
  })
  vmPrintListView1_adp.notifyDataSetChanged()
end
